package com.xintoucloud.pbs.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xintoucloud.pbs.dao.PartyMemberExamObjectDao;
import com.xintoucloud.pbs.entity.PartyMemberExamObject;
import com.xintoucloud.pbs.model.DataGrid;
import com.xintoucloud.pbs.service.PartyMemberExamObjectService;
@Service@Transactional
public class PartyMemberExamObjectServiceImpl implements PartyMemberExamObjectService{
	@Autowired
	private PartyMemberExamObjectDao partyMemberExamObjectDao;
	@Override
	public void insertPartyMemberExamObject(PartyMemberExamObject partyMemberExamObject) {
		partyMemberExamObjectDao.insertPartyMemberExamObject(partyMemberExamObject);		
	}
	@Override
	public List<PartyMemberExamObject> listPartyMemberExamObject() {
		return partyMemberExamObjectDao.listPartyMemberExamObject();
	}
	@Override
	public DataGrid<PartyMemberExamObject> listPartyMemberExamObject(int pages, int rows) {
		DataGrid<PartyMemberExamObject> pmeo=new DataGrid<PartyMemberExamObject>();
		int pageIndex = (pages - 1) * rows;
		List<PartyMemberExamObject> data=partyMemberExamObjectDao.listPartyMemberExamObject(pageIndex,rows);
		long count=partyMemberExamObjectDao.count();
		pmeo.setCount(count);
		pmeo.setData(data);
		if(data!=null) {
			pmeo.setCode(200);
			pmeo.setMsg("加载成功");
		}
		return pmeo;
	}

}
